//
//  HttpTools.swift
//  weibosina
//
//  Created by hwm on 16/8/29.
//  Copyright © 2016年 hwm. All rights reserved.
//

import UIKit
import AFNetworking

class HttpTools: AFHTTPSessionManager {

    static let tools: HttpTools = {
        let url = NSURL(string: "https://api.weibo.com/")
        let t = HttpTools(baseURL: url)
        
        // 设置AFN能够接收得数据类型
        t.responseSerializer.acceptableContentTypes = NSSet(objects: "application/json", "text/json", "text/javascript", "text/plain") as? Set<String>
        return t
    }()
    
    class func shareHttpTools() -> HttpTools {
        return tools
    }
}
